<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/ExamSystem/css/bootstrap.min.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/ExamSystem/css/bootstrap-admin-theme.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/ExamSystem/css/public-attribute.css" />
    <script type="text/javascript" src="${pageContext.request.contextPath}/ExamSystem/js/jquery-3.3.1.min.js" ></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/ExamSystem/js/bootstrap.min.js" ></script>
    <link href="${pageContext.request.contextPath}/ExamSystem/css/regiter.css" rel="stylesheet"/>
    <script language="JavaScript" src="${pageContext.request.contextPath}/ExamSystem/js/regiter.js" ></script>
    <title>忘记密码</title>
</head>
<body onload="changeImg()">
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 column">
                <div class=" navbar-collapse nav-divider">
                    <a class="navbar-brand" href="#"><strong>欢迎使用在线考试系统</strong></a>

                </div>
            </div>
        </div>
    </div>
</nav>

<div style="width: 100%; height: 100%">
    <div id="paswd_form">

        <form action="${pageContext.request.contextPath}/ForgetPasswordServlet" method="post" onSubmit="return check2()">
            <div style=" width:100%; height:380px; background-color:#2e6280;">
                <br>
                <div style="margin-top: 10px;">
                    <span id="text_messg" style="margin-left:15%;"></span>
                    <input type="text" placeholder="请输入账号" name="pawd_ipt_name" id="pawd_ipt_name" class="txt" value="" />
                </div>
                <br>
                <input type="password" placeholder="请输入密码" name="pawd_ipt_pass" id="pawd_ipt_pass" class="txt" value=""/>
                <br>
                <input type="password" placeholder="请确认密码" name="pawd_ipt_pass2" id="pawd_ipt_pass2" class="txt" value=""/>
                <br>
                <input type="text" id="pawd_vcode" placeholder="验证码" value="" />
                <span id="code" title="看不清，换一张" onclick="changeImg()"></span>

                <input  type="submit" value="确认修改" class="paswd_btn">

            </div>
        </form>
    </div>
</div>

<script src="${pageContext.request.contextPath}/ExamSystem/js/jquery-3.3.1.min.js"></script>
<script language="JavaScript">

    $('#pawd_ipt_name').blur(function(){
        var uname = $("#pawd_ipt_name").val();

        $.ajax({
            type:'post',
            data:'uname='+ uname,
            url:'${pageContext.request.contextPath}/ForgetUnameServlet',
            success:function(data){
                if(data=='yes'){
                    $("#text_messg").text("用户名正确！");
                    $("#text_messg").css("color","lime");
                    //$("#uname").next().removeClass().addClass("msg-success");
                    //$("#uname").next().text("用户名正确");
                }else{
                    $("#text_messg").text("用户名不存在！");
                    $("#text_messg").css("color","red");
                }
            }
        });
    });

    /*$('#pawd_ipt_pass').blur(function(){
        var upass = $("#pawd_ipt_pass").val();
        if (upass == ""){
            alert("密码不能为空，请重新输入！");
            return;
        }

    });

    $('#pawd_ipt_pass2').blur(function(){
        var upass2 = $("#pawd_ipt_pass2").val();
        if (upass2 == ""){
            alert("确认密码不能为空，请重新输入！");
            return;
        }
    });

    $('#vcode').blur(function(){
        var vcode = $("#vcode").val();
        if (vcode == ""){
            alert("验证码不能为空，请重新输入！");
            return;
        }
    });*/

</script>

</body>
</html>
